package com.demo.bean;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.List;

public class GeneralBeanDefinition implements BeanDefinition {

    private String beanClass;

    private String factoryClass;

    private String factoryBeanName;

    private String factoryMethodName;

    private ScopeEnum scopeEnum;

    private List<Object> constructorArgumentValues;

    private Constructor constructor;

    private Method method;

    private List<PropertyValue> propertyValues;

    private String initMethodName;

    @Override
    public String getBeanClass() {
        return this.beanClass;
    }

    @Override
    public String getFactoryClass() {
        return this.factoryClass;
    }

    @Override
    public String getFactoryBeanName() {
        return this.factoryBeanName;
    }

    @Override
    public String getFactoryMethodName() {
        return this.factoryMethodName;
    }

    @Override
    public boolean isSingleton() {
        return this.scopeEnum == null || ScopeEnum.SINGLETON.equals(this.scopeEnum);
    }

    @Override
    public boolean isPrototype() {
        return ScopeEnum.PROTOTYPE.equals(this.scopeEnum);
    }

    @Override
    public List<Object> getConstructorArgumentValues() {
        return this.constructorArgumentValues;
    }

    @Override
    public Constructor getConstructor() {
        return this.constructor;
    }

    @Override
    public void setConstructor(Constructor constructor) {
        this.constructor = constructor;
    }

    @Override
    public Method getFactoryMethod() {
        return this.method;
    }

    @Override
    public void setFactoryMethod(Method method) {
        this.method = method;
    }

    @Override
    public List<PropertyValue> getPropertyValues() {
        return this.propertyValues;
    }

    @Override
    public void setInitMethodName(String methodName) {
        this.initMethodName = methodName;
    }

    @Override
    public String getInitMethodName() {
        return this.initMethodName;
    }

    public void setPropertyValues(List<PropertyValue> propertyValues) {
        this.propertyValues = propertyValues;
    }

    public void setBeanClass(String beanClass) {
        this.beanClass = beanClass;
    }

    public void setFactoryClass(String factoryClass) {
        this.factoryClass = factoryClass;
    }

    public void setFactoryBeanName(String factoryBeanName) {
        this.factoryBeanName = factoryBeanName;
    }

    public void setFactoryMethodName(String factoryMethodName) {
        this.factoryMethodName = factoryMethodName;
    }

    public void setScopeEnum(ScopeEnum scopeEnum) {
        this.scopeEnum = scopeEnum;
    }

    public void setConstructorArgumentValues(List<Object> constructorArgumentValues) {
        this.constructorArgumentValues = constructorArgumentValues;
    }
}
